<?php defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->files ); ?>);" />
			</th>
			<th>
				<?php echo JText::_( 'File' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Modified' ); ?>
			</th>
			<th width="5%">
				<?php echo JText::_( 'LOADED' ); ?>
			</th>
		</tr>
	</thead>
	<?php
	$k = 0;
	JHTML::_('behavior.tooltip');
	for ($i=0, $n=count( $this->files ); $i < $n; $i++)
	{
		$file = &$this->files[$i];
		$loaded = &$this->files['loaded'];
		$checked 	= JHTML::_('grid.id', $i, $file['name'] );
		$link 		= JRoute::_( 'index.php?option=com_accounts&controller=files&task=load&cid[]='.$file['name'] );

		?>
		<tr class="<?php echo "row$k"; ?>">
			<td>
				<?php echo $checked; ?>
			</td>
			<td>
				<div id="link" class="hasTip link" title="<?php echo JText::_( 'Click for load' ); ?>"><a href="<?php echo $link; ?>"><?php echo $file['name']; ?></a></div>
			</td>

			<td>
				<?php echo $file['modified']; ?>
			</td>

			<td>
				<?php
				if($file['loaded'] == 1){
					?>
					<img src="templates/khepri/images/menu/icon-16-default.png" alt="<?php echo JText::_( 'LOADED' ); ?>" />
					<?php
				}
			?>
			</td>
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
	</table>
</div>
<input type="hidden" name="option" value="com_accounts" />
<input type="hidden" name="task" value="remove" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="files" />
</form>
<div id="uploadform">
  <form enctype="multipart/form-data" action="index.php" method="post" name="adminform">
  <table class="adminform">
	<tr>
		<th colspan="2"><?php echo JText::_( 'Upload File' ); ?></th>
	</tr>
	<tr>
		<td width="120">
			<label for="uploadfile"><?php echo JText::_( 'File' ); ?>:</label>
		</td>
		<td>
			<input type="file" id="uploadfile" name="uploadfile" size="50"/>
			<input type="submit" value=<?php echo JText::_( 'Upload File' ); ?>""/>
		</td>
	</tr>
	</table>
</div>
<input type="hidden" name="option" value="com_accounts" />
<input type="hidden" name="task" value="doUpload" />
<input type="hidden" name="controller" value="files" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
